package com.BookManager.mapper;

import com.BookManager.entity.Account;
import com.BookManager.entity.Student;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {
    @Select("select * from user where username = #{username}")
    Account getAccountByName(String username);

    @Results({
            @Result(column = "s_id",property = "sid"),
            @Result(column = "s_name",property = "name"),
            @Result(column = "s_sex",property = "sex"),
            @Result(column = "s_grade",property = "grade")
    })
    @Select("select * from student")
    List<Student> getStudentList();

    @Select("select * from user")
    List<Account> getAccountList();

}
